<!DOCTYPE html>
<html lang="en" style="height:100%">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>我的分享</title>

    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css"/>

    <link rel="stylesheet" type="text/css" href="../../css/yzl.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/swiper.css"/>
    <style>
    .member_info_top{
      background-color: #ffffff;
      height: 90px

    }
    *{
      -webkit-box-sizing: inherit;
              box-sizing: inherit;
    }
    .top-container{
      -webkit-box-sizing: border-box;
              box-sizing: border-box;
    }
    .member_portrait{
      float:left;
      width:90px;
      padding:10px;
      display:block;
      border-radius: 20px
    }
    .member_level{
      margin-top: 10px;
      background: #FDD96D;
      text-align: center;
      color: #ffffff;
      border-radius: 5px;
      width: 70px
    }
    .username{
    	max-width: 70vw;
    	white-space: nowrap;
      overflow: hidden;
    	text-overflow: ellipsis;
    	vertical-align: middle;
    }
    </style>
</head>
<body style="height:100%;">
  <div id="blank" class="header" style="-webkit-box-sizing: inherit;box-sizing: inherit;">
      <div v-back.tapmode class="back"></div>
      <span class="title">用户详情</span>
  </div>
  <div id="app" class="top-container" v-cloak>
    <div class="member_info_top">
      <img class="member_portrait" v-image-resize="{src:memberinfo.portrait?memberinfo.portrait:'../res/tx00.jpg'}">
      <div style="float:left">
        <div class="username">{{memberinfo.nickname}}</div>
        <div class="member_level" :style="getBg(memberinfo.level_id)">{{memberinfo.name}}</div>
      </div>
    </div>
    <ul class="aui-list aui-list-in"  style="margin-top:10px">
        <li class="aui-list-item">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-title">奶牛数</div>
                <div class="aui-list-item-right">{{memberinfo.cow}}</div>
            </div>
        </li>
      </ul>
    <div style="margin-top:20px" >
    <div style="background:#ffffff;text-align:center;padding:15px"  v-show="memberinfo.is_friend==0&&memberinfo.member_id!=mymember_id" v-myclick="[memberinfo.member_id, addfriends]">加为好友</div>
    <div style="background:#ffffff;text-align:center;padding:15px" v-show="memberinfo.is_friend==1&&memberinfo.member_id!=mymember_id" v-myclick="[memberinfo, startchat]">发消息</div>

    </div>
  </div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/url.js"></script>
<script src="../../script/swiper.js"></script>
<script>

var memberinfo;
apiready = function () {
  setBSImg();
  new Vue({
      el: '#blank'
  });
    api.parseTapmode();
    var uid = api.pageParam.uid;

    var data = {
        member_id: getPrefs('member_id'),
        target_id: uid,
    };
    var callback = function (ret) {
        memberinfo = ret.content;
        initApp();
        api.parseTapmode();
    };
    pinet.post(URL.getMemberInfo, data, callback);
};

function initApp() {
    vm = new Vue({
        el: '#app',
        data: {
            memberinfo: memberinfo,
            mymember_id:getPrefs('member_id')
        },
        computed: {
        },
        methods: {
          startchat:function(member){
            api.openWin({
              reload : true,
              name : 'win_chat',
              url : '../win/win_chat.html',
              pageParam : {
                id : member.member_im_id,
                zh : member.nickname,
                tx : member.portrait,
                level_id:member.level_id,
                friend_id:api.pageParam.uid
              },
              vScrollBarEnabled : false,
            });
            if (getPrefs('member_im_id') == member.member_im_id) {
            } else {
              var rong = api.require('rongCloud2');
              rong.clearMessagesUnreadStatus({
                conversationType : 'PRIVATE',
                targetId : member.member_im_id
              }, function(ret, err) {
              })
            }
            // api.sendEvent({
            // 	name : 'hhxx'
            // });
          },
          getBg: function (level_id) {
            var memberStyle = getMemberStyle(level_id);
            return {
                background:memberStyle.level_bg_color
            };
        },
          addfriends:function(member_id){
            api.openWin({
              reload : true,
              name : 'verify',
              url : 'verify.html',
              pageParam : {
                target_id : member_id,
                target_type:1,
                from_type:api.pageParam.from_type
              },
              vScrollBarEnabled : false,
            });
          },

        }

    });
}
</script>
</html>
